package com.ruoyi.hr.controller.hr.attendempmanage;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.Ztree;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zeo
 * @explain 考勤管理员工管理
 * @date 2020/3/13
 */
@Controller
@RequestMapping("/attendEmpManage")
public class AttendEmpManageController extends BaseController {

//    @Autowired
//    EntryExitManageService entryExitManageService;

    private String prefix = "hr/attendempmanage";

    /**
     * 跳转分页页面
     */
    @GetMapping()
    public String attendEmpManage() {
        return prefix + "/attendEmpManage";
    }

    /**
     * 欢迎
     */
    @GetMapping("/welcome")
    public String welcome() {
        return prefix + "/welcome";
    }

    /**
     * 加载左侧树状
     */
    @GetMapping("/treeData")
    @ResponseBody
    public List<Ztree> treeData() {
        List<Ztree> ztrees = new ArrayList<Ztree>();
        Ztree ztree[] = {
                new Ztree((long) 100, (long) 0, "考勤信息", "考勤信息"),
                new Ztree((long) 101, (long) 100, "考勤信息查看", "考勤信息查看"),

                new Ztree((long) 102, (long) 0, "新员工考勤", "新员工考勤"),
                new Ztree((long) 103, (long) 102, "新员工登记", "新员工登记"),
                new Ztree((long) 104, (long) 102, "历史查询", "历史查询"),

                new Ztree((long) 105, (long) 0, "考勤变动", "考勤变动"),
                new Ztree((long) 106, (long) 105, "考勤信息变动登记", "考勤信息变动登记"),
                new Ztree((long) 107, (long) 105, "考勤信息变动历史", "考勤信息变动历史"),
                new Ztree((long) 108, (long) 105, "考勤状态变动登记", "考勤状态变动登记"),
                new Ztree((long) 109, (long) 105, "考勤状态变动历史", "考勤状态变动历史"),

        };
        for (int i = 0; i < ztree.length; i++) {
            ztrees.add(ztree[i]);
        }
        return ztrees;
    }
//
//    @RequestMapping("/getEmpList")
//    @ResponseBody
//    public TableDataInfo getEmpList(@RequestParam Map map){
//        startPage();
//        List<Map<String,Object>> list = entryExitManageService.getEmpList(map);
//        return getDataTable(list);
//    }

}
